New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libvpx: fix configuration for arm64 #9252
Conversation
Notifying maintainers: |
Travis Build #15413 Passed. Lint results
Port libvpx success on xcode10.3. Log |
multimedia/libvpx/Portfile
Outdated
@@ -72,6 +72,10 @@ configure.args --enable-vp8 \ | |||
--disable-examples \ | |||
--disable-unit-tests | |||
|
|||
if { ${build_arch} eq "arm64" } { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not give you a correct build when using the universal variant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this! Hopefully the update I just pushed is the right way to fix this.
a0d22b6
to
9e1e8f7
Compare
Travis Build #15419 Passed. Lint results
Port libvpx success on xcode10.3. Log |
# Handle darwin variants. Newer SDKs allow targeting older | ||
# platforms, so use the newest one available. | ||
case ${toolchain} in | ||
- arm*-darwin*) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your patch removes the arm*-darwin*
case because it was iOS specific, but there's still an x86*-darwin*
case below. Are we sure that whatever the x86*-darwin*
case is doing for x86 macOS isn't also needed for arm64 macOS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The x86*-darwin*
version was setting -isysroot
to the MacOSX SDK, which wasn't needed for my build, but indeed looks important. I've fixed this now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, I just noticed #59360, which now is triggered on arm by including the x86*-darwin*
lines.
That entire case block with the nonsense osx_sdk_dir="$(configure.sdkroot)"
line has no effect apart from emitting a non-fatal command not found
error.
So the correct -isysroot
cflags and -syslibroot
ldflags were actually being set on my system already without this block--though I'm not sure exactly how. It looks like we should just remove this block entirely.
f29ef98
to
ac7aa72
Compare
Travis Build #15464 Passed. Lint results
Port libvpx success on xcode10.3. Log |
NB: upstream fix is here: |
and this is helpful too: webmproject/libvpx@723fca7 |
I did this, and it worked today:
|
Is this one going to get checked in? |
Folks, since ffmpeg depends on libvpx, plenty of downstream ports are being blocked for Big Sur ARM64... |
Ken, are your changes release-worthy, such that we could push this PR through...? |
kinda hack. no doubt Ryan has a much better plan, or we can wait for a new release upstream, which for all I know, not having recently looked, is already released... |
Basing this decision on |
While I don't have an M1 Mac (or a Big Sur VM yet either, for that matter), I can certainly try cross-compilation on a friend's Intel-based machine. If that would help move this along... ? |
yeah, I copy/pasted that bit out of this PR due to laziness, but it should be
this stuff: |
You can't really do this kind of fix without an arm mac to see if it actually works (and passes the tests, ideally)... Without a test run, it's all just imaginary. |
True. But was hoping to help with any related minutia, to simply keep things moving. |
No, it shouldn't. Set it properly in the correct array elements(s) of |
ryan, if you want to fix up this PR I'll test it. |
After applying: diff --git a/multimedia/libvpx/Portfile b/multimedia/libvpx/Portfile
index 4b1cc24f986..dee7784e2fb 100644
--- a/multimedia/libvpx/Portfile
+++ b/multimedia/libvpx/Portfile
@@ -64,7 +64,6 @@ configure.args --enable-vp8 \
--enable-pic \
--enable-postproc \
--enable-multithread \
- --enable-runtime-cpu-detect \
--enable-experimental \
--enable-shared \
--disable-install-docs \
@@ -76,8 +75,8 @@ configure.args --enable-vp8 \
# For arm64 builds (and universal builds targeting arm) we disable this feature,
# meaning NEON support is determined at compile time.
# For x86* architectures in universal builds, this feature is re-enabled below.
-if { ${build_arch} eq "arm64" || [variant_isset universal] } {
- configure.args-delete --enable-runtime-cpu-detect
+if {${configure.build_arch} in "i386 x86_64"} {
+ configure.args-append --enable-runtime-cpu-detect
} I can confirm this builds on an arm64 mac. If this could get merged soon, that would be great! |
It's still not quite right, but it does build. @ryandesign has pointed out what needs to be done, but he has 15 years more experience than I do mucking around with gorey dets of the muniversal PortGroup, and I just have not had time to read through that portgroup's sourcefiles and fix it the way he wants (the right way). So -- it sits until someone fixes it properly. This PR is not right, and should not be committed as is. |
Sorry to be a pest. But in the immortal words of fictional character Monica Geller, from the TV show Friends: "Nagging Works!" :-) Jokes aside, we really need to get this port building on arm64. So... what can I do to help? |
I think this diff against this PR's Portfile would do the job. It
--- multimedia/libvpx/Portfile.orig 2021-02-02 09:14:01.000000000 -0600
+++ multimedia/libvpx/Portfile 2021-02-02 09:14:25.000000000 -0600
@@ -64,7 +64,6 @@
--enable-pic \
--enable-postproc \
--enable-multithread \
- --enable-runtime-cpu-detect \
--enable-experimental \
--enable-shared \
--disable-install-docs \
@@ -72,14 +71,6 @@
--disable-examples \
--disable-unit-tests
-# libvpx does not yet support runtime detection of NEON features on macOS/iOS.
-# For arm64 builds (and universal builds targeting arm) we disable this feature,
-# meaning NEON support is determined at compile time.
-# For x86* architectures in universal builds, this feature is re-enabled below.
-if { ${build_arch} eq "arm64" || [variant_isset universal] } {
- configure.args-delete --enable-runtime-cpu-detect
-}
-
configure.env LD=${configure.cc}
# add in when docs are installed correctly Resulting configure line for arm64, show absence of --enable-runtime-cpu-detect
Resulting configure line for x86_64, showing --enable-runtime-cpu-detect at the end of the line.
|
I had to use a newer upstream github commit, not yet released, to build libvpx a month ago, as above, on arm64. |
The commit you referenced deals with changing configure to deal with arm-ios vs. arm-mac. This PR also patches configure for that reason but in a different way. So should this PR then be reworked to use a patch based on the upstream one? The current PR with my additional diff does build on arm64 and x86_64 (Big Sur) for me. |
The diff I put up a month ago built libvpx on BigSur arm64 and Intel as well, for me and anyone else who used it. We would always use the upstream patch, if available. In this case, there were a bunch of fixes, so I used a newer upstream commit. The only remaining issue we have is finessing the Portfile into using the muniversal PortGroup official commands, as Ryan pointed out. |
* Disable switch to the iphoneos sdk for arm targets * Disable unsupported "runtime-cpu-detect" feature on arm64 * Add arm64 to `supported_archs` Fixes: https://trac.macports.org/ticket/60940
OK -- I spent some time sorting this out, I think, after dinner here. I looks like this does all the right things on the BigSur Intel system I am presently working on. Need to test a pure arm64 build, a universal arm64 build, and then some universal i386/x86_64 builds to make sure this is covering all the bases properly. |
Catalina: |
@kencu I've tested this on my 64-bit Mac this end. All looks good. Pure arm64 build:
Universal build
FYI I'm running BigSur (11.2) and have tested basic functionalty with Hope that helps! |
Very good, thanks. Plain and universal builds on 10.6 and 10.11 work properly as well. So that is looking like a go. Last thing is to just nail down that version thing I did, make sure that is the way to go. @ryandesign @dbevans -- looking to commit this shortly, speak now or forever hold your peace please. |
rework universal building to current MP standards
supported_archs
Fixes: https://trac.macports.org/ticket/60940
Description
Gets libvpx building on Apple Silicon macs.
Type(s)
Tested on
macOS 11.0.1
Xcode 12.2
Verification
Have you
port lint
?sudo port -vst install
?